<html>
<head><meta charset="utf-8"><title>x.py dist and tools · t-infra · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/index.html">t-infra</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html">x.py dist and tools</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246198602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246198602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246198602">(Jul 16 2021 at 08:46)</a>:</h4>
<p>I'm trying to build rustc with a custom configuration and I <em>think</em> I found a problem in rustbuild</p>



<a name="246198782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246198782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246198782">(Jul 16 2021 at 08:48)</a>:</h4>
<p>according to <a href="https://github.com/rust-lang/rust/blob/057050a95bdfc5849a893208c53c7b2a081c6808/config.toml.example#L260-L271"><code>config.toml.example</code></a>, if I have this configuration:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[build]</span>
<span class="n">extended</span> <span class="o">=</span> <span class="kc">true</span>
<span class="n">tools</span> <span class="o">=</span> <span class="k">["cargo"]</span>
</code></pre></div>
<p>and I run <code>./x.py dist</code>, only rustc + rustdoc + cargo should be built, and clippy/rustfmt/etc should <em>not</em></p>



<a name="246198843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246198843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246198843">(Jul 16 2021 at 08:49)</a>:</h4>
<p>that seems to work as expected for both <code>./x.py build</code> and <code>./x.py install</code>, as both of those use <code>should_run()</code> to disable themselves by default if <code>!extended</code> or the tool is not present in <code>tools</code></p>



<a name="246198938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246198938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246198938">(Jul 16 2021 at 08:50)</a>:</h4>
<p>the <code>extended</code> step in <code>./x.py dist</code> seems to ignore the <code>tools</code> key completely though, except for <code>rustc-demangler</code></p>



<a name="246199005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246199005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246199005">(Jul 16 2021 at 08:51)</a>:</h4>
<p>things in <code>dist.rs</code> also seem to be using <code>assert!(config.extended)</code> to prevent running <code>./x.py dist src/tools/clippy</code> manually if one were to chose to do so, instead of just returning <code>false</code> in <code>should_run()</code></p>



<a name="246199061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246199061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246199061">(Jul 16 2021 at 08:52)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> is my understanding here correct? I'm happy to send patches to fix those if it's not the intended behavior (or update the docs if it is)</p>



<a name="246211668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246211668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246211668">(Jul 16 2021 at 11:33)</a>:</h4>
<p>I think it's not the intended behavior, there's an extensive collection of issues I'd guess about this - the tools key in general isn't too well integrated (particularly in dist)</p>



<a name="246211771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246211771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246211771">(Jul 16 2021 at 11:34)</a>:</h4>
<p>I don't really recall why/what extended is for, it feels like something we should maybe get rid of though. (Just require listing tools or not instead).</p>



<a name="246213145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246213145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246213145">(Jul 16 2021 at 11:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools/near/246211771">said</a>:</p>
<blockquote>
<p>I don't really recall why/what extended is for, it feels like something we should maybe get rid of though. (Just require listing tools or not instead).</p>
</blockquote>
<p><code>extended</code> is both a toggle for "build non-rustc and non-rustdoc tools" and also produces the "combined" tarball</p>



<a name="246213952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246213952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246213952">(Jul 16 2021 at 12:02)</a>:</h4>
<p>Hm, seems like it might be good to integrate that with tools = - to avoid having tools listed but extended off. I think we could probably always produce the combined tarball, just sometimes it'll be empty. (Or skip production if it ends up empty)</p>



<a name="246461958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/x.py%20dist%20and%20tools/near/246461958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pietro Albini <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/x.2Epy.20dist.20and.20tools.html#246461958">(Jul 19 2021 at 14:30)</a>:</h4>
<p>ok opened <a href="https://github.com/rust-lang/rust/pull/87282">https://github.com/rust-lang/rust/pull/87282</a> fixing this</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>